<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>标题</title>

  <link rel="stylesheet" href=""/>
  <style></style>
</head>
<body>
<div id="aa"></div>
<script type="text/javascript">
  var str='小明，你又没及格，为什么不好好学习？你还瞪眼！小明，明天把你妈妈叫来。';
  var reg=/小明|又/;
  var str1 = reg.exec(str);
  var str2 = reg.test(str);
  console.log(str1);
  console.log(str2)
    var str2 = str.replace(reg,'xxxx');
//  var aa = document.getElementById('aa');
//  aa.innerHTML = str2;
</script>
</body>
</html>